<template>
    <div>
        <div class="page_top">
            <div class="left_btn" @click="back">
                <img src="../../assets/image/back.png" alt=""/>
            </div>
            <crumbs basetitle="保险" title="保险规则" title1=""></crumbs>
        </div>
        <div class="w-full box-border p-16px">
            <div class="w-full bg-#ffffff rounded-4px box-border p-16px">
                <div class="w-full box-border mb-8px font-bold">
                    <div class="w-100px box-border pb-14px border-b-#3E5FF5 border-b-solid border-2px">在保证明设置
                    </div>
                </div>
                <tableComponent class="set-height" :table-header="tableHeader" :table-data="tableData"
                                v-model:page-info="pageInfo" @pageChange="handlePageChange">
                    <template #isOpenPaySalary>
                        <el-table-column prop="operate" label="操作" width="120" align="center">
                            <template #default="scope">
                                <el-button type="primary" link @click="onEdit">编辑</el-button>
                            </template>
                        </el-table-column>
                    </template>
                    <template #operate>
                        <el-table-column prop="operate" label="操作" width="120" align="center" fixed="right">
                            <template #default="scope">
                                <el-button type="primary" link @click="isShow = true">编辑</el-button>
                            </template>
                        </el-table-column>
                    </template>
                </tableComponent>
            </div>
        </div>
        <editDialog v-model:show="isShow"></editDialog>
    </div>
</template>

<script setup>
import crumbs from '@/components/crumbs.vue'
import editDialog from './edit-dialog/edit-dialog.vue'
import tableComponent from '@/components/tableComponent/index.vue'
import {ref} from 'vue'

const isShow = ref(false)
const pageInfo = ref({
    pageNum: 1,
    pageSize: 10,
    total: 0
})

const tableHeader = ref([
    {
        label: '序号',
        prop: 'companyId'
    },
    {
        label: '保险公司',
        prop: 'isOpenPaySalary',
        width: 450
    },
    {
        label: '生效范围',
        prop: 'isOpenPaySalary2'
    },
    {
        label: '生成方式',
        prop: 'isOpenPaySalary3'
    },
    {
        label: '生成次数',
        prop: 'isOpenPaySalary4'
    },
    {
        label: '状态',
        prop: 'isOpenPeriod'
    },
    {
        label: '操作',
        prop: 'operate'
    }
])
const tableData = ref([1])

const handlePageChange = () => {
    console.log('分页')
    getData()
}
const getData = () => {
    console.log('获取数据')
}
const onEdit = () => {
    console.log(111)
    isShow.value = true
}
const back = () => {
    window.history.back()
}
</script>

<style lang="scss" scoped></style>